package com.kgar.entity.graph.node;

import com.kgar.entity.graph.relationship.RelevantToRelation;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.neo4j.core.schema.*;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;

@Data
@Node("JobPosition")
@ToString
public class JobPositionNode implements Serializable {
    @Id
    private Long jobPositionId;

    //职位标题
    private String title;

    //1：实习；2：兼职；3：全职
    private String workType;

    //每周出勤天数
    private Integer workPerWork;

    //最低薪资
    private String mixSalary;

    //最高薪资
    private String maxSalary;

    //薪资范围
    private String salaryRange;

    //职位描述
    private String description;

    //HR 人名
    private String hiring_manager;

    //最近活跃时间
    private String last_active;

    private String link ="";

    private List<String> tag;

    private Long companyId;

    private Long educationId;

    @Relationship(value = "BELONGS_TO")
    private CompanyNode company;

    @Relationship(value = "DEGREE_REQUIRED")
    private EducationNode education;

    @Relationship(value = "RELEVANT_TO")
    private List<RelevantToRelation> relevantToRelations;
//
//    @Relationship(type = "INCLUDED_IN")
//    private IndustrialCategoryNode industrialCategory;
//
//    @Nullable
//    @Relationship(type = "NEED")
//    private SkillNode skill;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        JobPositionNode that = (JobPositionNode) o;
        return Objects.equals(jobPositionId, that.jobPositionId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(jobPositionId);
    }
}
